import request from "@/utils/request";

// 获取菜单列表
export function getMenuListService(params) {
  return request({
    url: "/menus/list",
    method: "get",
    params,
  });
}

// 新增或更新菜单
export function addOrUpdateMenuService(data) {
  return request({
    url: data.id ? `/menus/update/${data.id}` : "/menus/create",
    method: data.id ? "put" : "post",
    data,
  });
}

// 删除菜单
export function deleteMenuService(id) {
  return request({
    url: `/menus/delete/${id}`,
    method: "delete",
  });
}

// 更新菜单状态
export function updateMenuStatusService(data) {
  return request({
    url: "/menus/update/status",
    method: "post",
    data,
  });
}
